Skip to content

[pull] main from tldraw:main#491

Merged
pull[bot] merged 2 commits intocode:mainfrom
tldraw:main
Apr 10, 2026
Merged

[pull] main from tldraw:main#491
pull[bot] merged 2 commits intocode:mainfrom
tldraw:main

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 10, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

In order to support embedding Canva designs on the tldraw canvas (closes
#6473), this PR adds Canva as a recognized embed type alongside Figma,
Google Maps, YouTube, and others.

Canva design URLs matching `canva.com/design/<id>/<slug>` are detected
and converted to embeddable iframes by appending the `?embed` query
parameter. The reverse conversion (`fromEmbedUrl`) strips the parameter
to recover the original share URL.

- [ ] Get Canva logo

### Change type

- [x] `feature`

### Test plan

1. Paste a Canva design URL (e.g.
`https://www.canva.com/design/DAFrLlkQu3Q/view`) onto the canvas
2. Verify an embed shape is created with the Canva design rendered
inside an iframe
3. Verify that non-design Canva URLs (e.g.
`https://www.canva.com/templates`) are not converted to embeds

- [x] Unit tests

### Release notes

- Add Canva as a supported embed type. Pasting a Canva design URL now
creates an embedded iframe on the canvas.

### API changes

- Added `canva` to `DEFAULT_EMBED_DEFINITIONS` with `type: 'canva'`,
`hostnames: ['canva.com']`

### Code changes

| Section         | LOC change |
| --------------- | ---------- |
| Core code       | +33 / -0   |
| Tests           | +46 / -0   |
| Automated files | +17 / -0   |
…eak (#8476)

In order to fix a memory leak where unmounted `Editor` instances were
retained via `window.__tldraw__hardReset`, this PR removes the global
window assignments from `hardReset.ts` and has `runtime.hardReset()`
call `hardReset` directly instead of dispatching through
`window.__tldraw__hardReset`. The global was capturing the module scope
(including a debounced `updateHoveredShapeId` closure that held
`getContainer` → `Editor`), causing ~5.9 MB to be retained per editor
after unmount.

Closes #8430.

### Change type

- [x] `bugfix`

### Test plan

1. Mount a tldraw editor, then unmount it.
2. Take a heap snapshot and confirm the `Editor` instance is no longer
retained via `Window.__tldraw__hardReset`.
3. Verify `editor.hardReset()` (via `runtime.hardReset()`) still clears
local data and reloads.

### Release notes

- Fix a memory leak where `Editor` instances were retained after unmount
via the `window.__tldraw__hardReset` global.
@pull pull Bot locked and limited conversation to collaborators Apr 10, 2026
@pull pull Bot added the ⤵️ pull label Apr 10, 2026
@pull pull Bot merged commit f847560 into code:main Apr 10, 2026
4 of 7 checks passed
@pull pull Bot had a problem deploying to deploy-production April 10, 2026 15:13 Failure
@pull pull Bot had a problem deploying to deploy-staging April 10, 2026 15:13 Error
@pull pull Bot had a problem deploying to deploy-staging April 10, 2026 15:13 Error
@pull pull Bot had a problem deploying to vsce publish April 10, 2026 15:13 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant